<!DOCTYPE HTML />
<html>
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>人气之星</title>
    <?php include_once("common/common_js.php") ?>
    <link href="/css/main.css" rel="stylesheet"/>
</head>
<body>
<?php include_once("common/banner.php"); ?>
<div class="warpper">
    <?php include_once("common/mini_header.php"); ?>
    <div class="part_a " style="height:380px;">
        <div class="l">
            <div class="title">今日人气之星</div>
            <?php if ($view['dayStar']['applicationId'] > 0) { ?>
            <div style="margin-top:5px;"><a
                    href="/index.php/stars/xuanshou/<?php echo $view['dayStar']['applicationId']; ?>"><img
                    src="<?php echo $view['dayStar']['photo'] ?>"
                    style="width:275px;height: 218px;"/></a></div>
            <div class="infob">
                <div class="name"><?php echo $view['dayStar']['name'] ?>(<?php
                 $userVote = $this->modules->UserVote;
                    echo $userVote->findCountByUserId($view['dayStar']['applicationId'] == "" ? 0
                                                              : $view['dayStar']['applicationId'], 1);
                    ?>票) |<span style="cursor: pointer"
                                onclick="voteApplication(<?php echo $view['dayStar']['applicationId'] ?>)">投票</span>
                </div>
            <div class="info">
                <label><?php echo $view['dayStar']['motto'] ?></label>
                    <span>年龄：<?php echo $view['dayStar']['age'] ?> 身高：<?php echo $view['dayStar']['height'] ?>
                        cm 体重:<?php echo $view['dayStar']['weight'] ?>kg</span>
            </div></div>
                                                                         <?php

        }
        else
            echo "<img src='/img/none.jpg' style='width:275px;height: 328px;'/>";
            ?>


        </div>

        <div class="r">
            <div class="infob rqzx" style="margin-top:0;height:365px;">
                <?php foreach ($view['dayStars'] as $value) { ?>
                <div>
                    <a href="/index.php/stars/xuanshou/<?php echo $value['applicationId']; ?>"><img
                            src="<?php echo $value['photo'] ?>" width="90" height="90" alt=""/></a>

                    <p><?php echo $value['name'] ?>(<?php
                 $userVote = $this->modules->UserVote;
                        echo $userVote->findCountByUserId($value['applicationId'] == "" ? 0
                                                                  : $value['applicationId'], 1);
                        ?>票)|<a href='#'
                                onclick="voteApplication(<?php echo $value['applicationId']; ?>)">投票</a></p>
                </div>
                <?php }?>
            </div>

        </div>
    </div>
<?php include("common/footer.php"); ?>
</div>

<script type="text/javascript">
    function voteApplication($applicationId) {
        $.get("<?php echo URL_PREFIX; ?>/ajax/voteApplication", {operatorId:1,operatedId:$applicationId}, function(data) {
            alert(data);
        })
    }
</script>
</body>
</html>